﻿using ProjectFootball.MVC.Foundation;
using ProjectFootball.MVC.Foundation.ResourceLibrary;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Security.Principal;

namespace ProjectFootball.MVC.Models.EntityFramework.Entities
{
    public class Campaign : BaseApprovableEntity, IApprovableEntity
    {
        #region Constructors
        public Campaign()
        {
        }

        public Campaign(IPrincipal user, CreateType createType, Guid approvalGuid, Guid competitionGuid, DateTime startDate, DateTime endDate)
            :base(user, createType, approvalGuid)
        {
            CompetitionGuid = competitionGuid;
            StartDate = startDate;
            EndDate = endDate;
        }
        #endregion

        [ForeignKey("Competition")]
        public Guid CompetitionGuid { get; set; }

        public DateTime StartDate { get; set; }

        public DateTime EndDate { get; set; }
        
        [ForeignKey("CompetitionGuid")]
        public virtual Competition Competition { get; set; }
    }
}